package com.tt.controller;

import com.tt.service.TimeSelectorService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * <p>
 *
 * </p>
 *
 * @version 1.0
 * @auther sugarttt
 * @since 2022-11-10 10:28:50
 */
@RestController
public class TimeSelectorController {

    private final TimeSelectorService timeSelectorService;

    public TimeSelectorController(TimeSelectorService timeSelectorService) {
        this.timeSelectorService = timeSelectorService;
    }


    /**
     * get year
     */
    @GetMapping("/getYears")
    public ArrayList<String> getYears() {
        return timeSelectorService.getYears();
    }

    /**
     * get all emission
     */
    @GetMapping("/getAllEmission")
    public ArrayList<Double> getAllEmission() {
        return timeSelectorService.getAllEmission();
    }
}
